#ifndef __S264_BS_H__
#define __S264_BS_H__

#ifdef __cplusplus
extern "C"
{
#endif
#include "impl.h"
	typedef struct bs_st
	{
		u8 *start;
		u8 *end;
		u8 *cur;
		u8 bit_offset;
	}bs_t;
	extern i8 bs_eof(bs_t *bs);
	extern i8 bs_init(bs_t *bs, u8 *buf, u64 len);
	extern u32 bs_read1bit(bs_t *bs);
	extern u64 bs_readnbit(bs_t *bs, u64 n);
	extern u64 bs_readue(bs_t *bs);
	extern i64 bs_readse(bs_t *bs);
	
#ifdef __cplusplus
}
#endif
#endif